actionSearch = function() {
	var strKeyword = $.trim($('#keyword').val());
	if(strKeyword == '') {
		alert(name_required);
		return false;
	} else if(strKeyword != '' && strKeyword.length < 3) {
		alert(name_minlength);
		return false;
	}
	return true;
}
$(document).ready(function() {	
	$.cookie('AUTOLOAD_BLOG', 1);
	$(window).scroll(function(){			
		if  ($(window).scrollTop() == $(document).height() - $(window).height()){
			loadBlog();
		}
	}); 
});
function loadBlog() {	
	var intPage 	= $('#ppage').val();	
	var strKeyword	= $('#keyword').val();
	if($.cookie('AUTOLOAD_BLOG') == 1 && intPage > 0 && strKeyword != '') {
		$.cookie('AUTOLOAD_BLOG',0);	
		$('.boxBlog .loading').show();
		$.getJSON(				
			HOST_VFRIEND + 'ajax/blog?act=6&page='+intPage+'&keyword='+encodeURIComponent(strKeyword)+'&callback=?',		
			function(response) {	
				var msg 	= response['msg'];
				var error	= response['error'];
				if(error == 0) {
					$('#ppage').remove();
					$('.boxBlog .loading').remove();					
					$('.boxBlog #blogItem').append(response['dblog']);
				} else {
					alert(msg);
				}
				$.cookie('AUTOLOAD_BLOG', 1);
			}
		);
	}
}